package com.api.tag.follow;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.test.context.ContextConfiguration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import com.api.test.AbstractApiTest;
import com.zyncro.api.ITagApiService;
import com.zyncro.api.exceptions.ZyncroApiException;

@ContextConfiguration(locations = { "classpath:/tags/tags-context.xml" })
public class FollowTag extends AbstractApiTest {

	@Value("#{statictags['user.toFollowTag'].appId}")
	private String followTagUserUrn;

	@Value("#{statictags['user.toFollowTag'].password}")
	private String followTagUserPassword;

	@Value("#{statictags['category.urn']}")
	private String categoryToFollowUrn;

	@Value("#{statictags['location.urn']}")
	private String locationToFollowUrn;

	@BeforeClass
	protected void setParameters() throws Exception {

		getApi().login(followTagUserUrn, followTagUserPassword);
	}

	@Test
	public void testFollowCategory() throws ZyncroApiException {

		getApi().getService(ITagApiService.class).followTag(categoryToFollowUrn);
	}

	@Test
	public void testFollowLocation() throws ZyncroApiException {

		getApi().getService(ITagApiService.class).followTag(locationToFollowUrn);
	}
}
